import { createRouter, createWebHistory } from 'vue-router'
import login from '@/views/login/index.vue'
import layout from '@/views/layout/index.vue'
import home from '@/views/home/index.vue'
import catagory from '@/views/catagory/index.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  //配置path 和component对应关系的位置
  routes: [
    {
      path: '/',
      component: layout,
      children:[
        {
          path: '',
          component: home
        },
        {
          path: 'catagory',
          component: catagory
        }
      ]
    }
    ,
    {
      path: '/login',
      component: login
    }
  ]
})

export default router
